package com.ruoyi.common.translation.core.impl;

import com.ruoyi.common.translation.annotation.TranslationType;
import com.ruoyi.common.translation.constant.TransConstant;
import com.ruoyi.common.translation.core.TranslationInterface;
import com.ruoyi.system.api.HnRemoteWorkService;
import lombok.AllArgsConstructor;
import org.apache.dubbo.config.annotation.DubboReference;

@AllArgsConstructor
@TranslationType(type = TransConstant.WORK_ID_TO_NAME)
public class HnWorkNameTranslationImpl implements TranslationInterface<String> {

    @DubboReference
    private HnRemoteWorkService workService;

    @Override
    public String translation(Object key, String other) {
        return workService.selectNameByIds(key.toString());
    }
}
